import server from '@/utils/request'

// 获取列表和查询
export function getCategory(name,page){
    return server({
        url: '/category',
        method: 'get',
        params: {
            name,
            page
        }
    })
}

// 添加
export function addCategory(category){
    return server({
        url: '/category',
        method: 'post',
        data: category
    })
}

// 修改
export function updateCategory(category){
    return server({
        url: '/category',
        method: 'put',
        data: category
    })
}

// 删除
export function deleteCategory(id){
    return server({
        url: `/category/${id}`,
        method: 'delete'
    })
}
